﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
namespace Rmlife.Common
{
    public static class MyComfiguration
    {
        public static string GetStringAppSetting(string key)
        {
            string result = ConfigurationManager.AppSettings[key];
            if (string.IsNullOrEmpty(result))
                result = string.Empty;

            return result;
        }

        public static int GetInt32AppSetting(string key, int defaultValue)
        {
            string result = ConfigurationManager.AppSettings[key];
            int v = defaultValue;
            if (!string.IsNullOrEmpty(result))
            {
                v = TypeParse.StrToInt(result, defaultValue);
            }

            return v;
        }
    }
}
